package com.niiwoo.civet.account.service.local;

import com.niiwoo.civet.account.dao.entity.OpenAccountOrder;
import com.niiwoo.civet.account.dao.mapper.OpenAccountOrderMapperExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 个人绑卡注册订单服务
 */
@Service
public class OpenAccountOrderService {

    @Autowired
    OpenAccountOrderMapperExt openAccountOrderMapperExt;

    /**
     * 获取开户订单
     *
     * @param requestNo 请求流水号
     */
    public OpenAccountOrder getByRequestNo(String requestNo) {
        return openAccountOrderMapperExt.selectByRequestNo(requestNo);
    }

    public boolean saveOrder(OpenAccountOrder order) {
        return openAccountOrderMapperExt.insertSelective(order) > 0;
    }

    public boolean updateOrder(OpenAccountOrder order) {
        return openAccountOrderMapperExt.updateByPrimaryKeySelective(order) > 0;
    }

}
